/*
Copyright (C) 2012 Brady Vidovic

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ftr.gson;

import com.google.gson.Gson;
import java.util.List;

/**
 * 
 * @author Brady Vidovic
 */
public class Schedule 
{    
    public static void main(String[] test)
    {
        new Schedule("test");        
    }
    public Schedule(String forTestingOnly)
    {                        
        String test_json =         
                //sample response:
            "    {"+
            "        \"ChannelType\": 0,"+
            "        \"IsActive\": true,"+
            "        \"IsOneTime\": false,"+
            "        \"KeepUntilMode\": 3,"+
            "        \"KeepUntilValue\": 3,"+
            "        \"LastModifiedTime\": \"/Date(1328882956000-0600)/\","+
            "        \"Name\": \"Good Morning America\","+
            "        \"PostRecordSeconds\": null,"+
            "        \"PreRecordSeconds\": null,"+
            "        \"ProcessingCommands\": ["+
            "            {"+
            "                \"Name\": \"Recording Start (live)\","+
            "                \"ProcessingCommandId\": \"11900dfd-f114-4717-8616-0d86dd6eb9ee\""+
            "            },"+
            "            {"+
            "                \"Name\": \"Recording End\","+
            "                \"ProcessingCommandId\": \"d28154a4-ff6f-4ab5-aa31-58db5cd845b5\""+
            "            },"+
            "            {"+
            "                \"Name\": \"Before Delete\","+
            "                \"ProcessingCommandId\": \"e89584fc-3ede-46ea-aab0-00b5b97118b4\""+
            "            }"+
            "        ],"+
            "        \"RecordingFileFormatId\": null,"+
            "        \"Rules\": ["+
            "            {"+
            "                \"Arguments\": ["+
            "                    \"Good Morning America\""+
            "                ],"+
            "                \"Type\": \"TitleEquals\""+
            "            },"+
            "            {"+
            "                \"Arguments\": ["+
            "                    \"3ec1177c-b30d-495e-a430-db0abd10c2b9\""+
            "                ],"+
            "                \"Type\": \"Channels\""+
            "            }"+
            "        ],"+
            "        \"ScheduleId\": \"188dfff7-358e-4d04-8dc6-0943017d3b46\","+
            "        \"SchedulePriority\": -1,"+
            "        \"ScheduleType\": 82,"+
            "        \"Version\": 3"+
            "    }";
        
        
        
        Gson gson = FTRGson.getFTRGson();
        Schedule testSchedule = gson.fromJson(test_json, Schedule.class);
        System.out.println(gson.toJson(testSchedule));
        
    }       

    public Integer ChannelType, KeepUntilMode, KeepUntilValue, PostRecordSeconds, PreRecordSeconds, RecordingFileFormatId, SchedulePriority, ScheduleType, Version;
    public boolean IsActive, IsOneTime;
    public FTRDate LastModifiedTime;
    public String Name, ScheduleId;
    public List<ProcessingCommand> ProcessingCommands;
    public List<Rule> Rules;       
    
    
}


